<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WEAVER行政执法信息系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<link rel="stylesheet" href="layui/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="layui/style/admin.css" media="all">
	<link rel="stylesheet" href="css/main.css" media="all">
	<script type="text/javascript" src="echarts/echarts.js"></script>
    <script type="text/javascript" src="jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
	<legend>
	欢迎<span style="color: red;"><shiro:principal property="showname"></shiro:principal></span>来到<span style="color: #0181ce;font-weight: bold;">
	WEAVER行政执法信息系统主页</span>！当前时间：<span id="currentTime"></span>
	</legend>
</fieldset>
<div class="main-contain">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
		<div class="layui-card">
			<div class="layui-card-header">session用户列表</div>
			<div class="layui-card-body" style="height: 280px;;overflow: auto;">
				<table class="layui-table layui-form">
					<thead>
						<tr>
							<th>序号</th>
							<th>会话ID</th>
							<th>登录账户</th>
							<th>用户名</th>
							<th>主机地址</th>
							<th>最后访问时间</th>
					</thead>
					<tbody>
						<tr th:each="userOnline,iterStat: ${userOnlineList}">
							<td th:text="${iterStat.index+1}"></td>
							<td th:text="${userOnline.sessionId}"></td>
							<td th:text="${userOnline.UUsrUser36.username}"></td>
							<td th:text="${userOnline.UUsrUser36.showname}"></td>
							<td th:text="${userOnline.host}"></td>
							<td th:text="${userOnline.lastAccess}"></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-header">系统信息</div>
        <div class="layui-card-body">
          	<table class="layui-table">
                <tbody>
                	<tr>
                        <th>操作系统</th>
                        <td style="color: #0181ce;" th:text="${system.systemName}"></td>
                    </tr>
                    <tr>
                        <th>操作系统用户名</th>
                        <td style="color: #0181ce;" th:text="${system.systemUserName}"></td>
                    </tr>
                	<tr>
                        <td>登录IP地址</td>
                        <td style="color: #0181ce;" th:text="${system.ip}"></td>
                    </tr>
                    <tr>
                        <th>运行环境</th>
                        <td style="color: #0181ce;" th:text="${system.tomcat}"></td>
                    </tr>
                    <tr>
                        <th>Java版本</th>
                        <td style="color: #0181ce;" th:text="${system.JavaVersion}"></td>
                    </tr>
                    <tr>
                        <th>MySQL版本</th>
                        <td style="color: #0181ce;">MySQL5.7</td>
                    </tr>
                    <tr>
                        <th>Redis版本</th>
                        <td style="color: #0181ce;" th:text="${system.Redis}"></td>
                    </tr>
                </tbody>
            </table>
        </div>
      </div>
    </div>
  </div>
</div> 
<script src="layui/layui/layui.js"></script>    
<script type="text/javascript" th:inline="javascript">
$(function() {
	getTime();
})
function getTime() {
    var dateObj = new Date();
    var year = dateObj.getFullYear();//年
    var month = dateObj.getMonth()+1;//月  (注意：月份+1)
    var date = dateObj.getDate();//日
    var day = dateObj.getDay();
    var weeks = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
    var week = weeks[day];//根据day值，获取星期数组中的星期数。
    var hours = dateObj.getHours();//小时
    var minutes = dateObj.getMinutes();//分钟
    var seconds = dateObj.getSeconds();//秒
    if(month<10){
        month = "0"+month;
    }
    if(date<10){
        date = "0"+date;
    }
    if(hours<10){
        hours = "0"+hours;
    }
    if(minutes<10){
        minutes = "0"+minutes;
    }
    if(seconds<10){
        seconds = "0"+seconds;
    }

    var newDate = year+"年"+month+"月"+date+"日"+hours+":"+minutes+":"+seconds+"&nbsp &nbsp"+week;
    document.getElementById("currentTime").innerHTML =newDate;//在div中写入时间
    setTimeout('getTime()', 500);//每隔500ms执行一次getTime()
}
</script>
</body>
</html>